﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;

namespace proj3
{
    public partial class Addform : Form
    {
        public Addform()
        {
            InitializeComponent();
        }

        private void exitbtn_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void addbtn_Click(object sender, EventArgs e)
        {
            String name = nametxt.Text;
            String country = countrytxt.Text;
            String year = yeartxt.Text;
            String work = worktxt.Text;
            String summary = summarytxt.Text;
            String link = linktxt.Text;
            StreamWriter sw = new StreamWriter("./data.txt", true);
            string str = name + "|" + country + "|" + year + "|" + work +"|"+ summary + "|"+link;
            sw.Write("\n"+str);
            Program.nameList.Add(new Philosopher(str));
            sw.Close();
            this.Close();

        }

    }
}
